@extends('common')
@section('content')

    <form class="form-inline definewidth m20" action="{{url('/execu/excelOut')}}" method="get">
        学员编号：
        <input type="text" name="use_num"  class="abc input-default" placeholder="如：XY20161001" value="">&nbsp;&nbsp;
        姓名：
        <input type="text" name="use_name"  pattern="^[\u4e00-\u9fa5]{2,17}$" class="abc input-default" placeholder="如：张三" value="">&nbsp;&nbsp;
        手机号：
        <input type="text" name="use_phone" pattern="^1[3-9]\d{9}$" class="abc input-default" placeholder="如：13872954567" value="">&nbsp;&nbsp;
        报名时间：
        <input type="text" name="use_enty" id="indate" class="abc input-default" pattern="^\d{4}-\d{2}-\d{2}$" placeholder="如：2014-01-01" value="">&nbsp;&nbsp;
        <br />
        <br />
        学习阶段：
        <select name="suj_id" style="width:150px">
            <option value="">--请选择--</option>
            @foreach($sub_info as $v)
                <option value="{{$v['sub_id']}}">{{$v['sub_name']}}</option>
                @endforeach
        </select>&nbsp;&nbsp;
        车型：
        <select name="per_id" style="width:150px">
            <option value="">--请选择--</option>
            @foreach($pap_info as $v)
                <option value="{{$v['pap_id']}}">{{$v['pap_name']}}</option>
            @endforeach
        </select>&nbsp;&nbsp;
        性别：
        <select name="use_sex" style="width:150px">
            <option value="">--请选择--</option>
            <option value="1">
                男
            </option>
            <option value="2">
                女
            </option>
        </select>&nbsp;&nbsp;
        状态：
        <select name="stu_state" style="width:150px">
            <option value="">--请选择--</option>
            @foreach($sta_info as $v)
                <option value="{{$v['ust_id']}}">{{$v['ust_state']}}</option>
            @endforeach
        </select>
        &nbsp;&nbsp;
        <span style="float: right;"><button type="button" id="search" class="btn btn-primary">查询</button>&nbsp;&nbsp;<button type="submit" class="btn btn-primary">导出</button>&nbsp;&nbsp;<button type="button" class="btn btn-primary">登记新学员</button></span>
    </form>
    <div id="tab">
    <table class="table table-bordered table-hover definewidth m10" >
        <thead>
        <tr>
            <th>序号</th>
            <th>编号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>身份证号</th>
            <th>手机号码</th>
            <th>车型</th>
            <th>学习阶段</th>
            <th>报名时间</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        @foreach($online_info['data'] as $k=>$v)
        <tr>
            <td>{{$k+1}}</td>
            <td>{{$v['use_num']}}</td>
            <td>{{$v['use_name']}}</td>
            <td>@if($v['use_sex']=='1'){{"男"}}@else{{"女"}}@endif</td>
            <td>{{$v['use_card']}}</td>
            <td>{{$v['use_phone']}}</td>
            <td>{{$v['pap_name']}}</td>
            <td>{{$v['sub_name']}}</td>
            <td>{{$v['use_enty']}}</td>
            <td>{{$v['ust_state']}}</td>
            <td><a href="{{url('execu/updateStuInfo')}}?id={{$v['stu_id']}}">修改</a></td>
        </tr>
        @endforeach
    </table>
    <div class="inline pull-right page">
        {{$online_info['total']}} 条记录 {{$online_info['current_page']}}/{{$online_info['last_page']}} 页
        <a href="{{url('/execu/online')}}?page=1&&s_data={{$s_data}}">第一页</a>
        @if($online_info['current_page']>5)
            <a href='{{url('/execu/online')}}?page={{$num['min']-5}}&&s_data={{$s_data}}' >上5页</a>
        @endif
        <a href="{{url('/execu/online')}}?page={{$online_info['current_page']-1<1?1:$online_info['current_page']-1}}&&s_data={{$s_data}}">上一页</a>
        @for($i=$num['min'];$i<=$num['max'];$i++)
            @if($i ==$online_info['current_page'])
                <a href="{{url('/execu/online')}}?page={{$i}}&&s_data={{$s_data}}" class='current'>{{$i}}</a>
            @else
                <a href="{{url('/execu/online')}}?page={{$i}}&&s_data={{$s_data}}">{{$i}}</a>
            @endif
        @endfor
        <a href="{{url('/execu/online')}}?page={{$online_info['current_page']+1>$online_info['last_page']?$online_info['last_page']:$online_info['current_page']+1}}&&s_data={{$s_data}}">下一页</a>
        @if($online_info['last_page']>5&&$online_info['current_page']<=ceil($online_info['last_page']/5-1)*5)
            <a href='{{url('/execu/online')}}?page={{$num['max']+1}}&&s_data={{$s_data}}' >下5页</a>
        @endif
        <a href="{{url('/execu/online')}}?page={{$online_info['last_page']}}&&s_data={{$s_data}}" >最后一页</a>
    </div>
    </div>
    <script src="{{url('api/jedate/jedate.js')}}"></script>
    <script type="text/javascript">
        jeDate({
            dateCell:"#indate",
            format:"YYYY-MM-DD",
            isinitVal:false,
            isTime:true, //isClear:true,
            minDate:"2000-01-01",
            okfun:function(val){alert(val)}
        });
        $(document).ready(function(){
            $("#search").click(function(){
                $(this).attr('disabled','true');
                var url="{{ url('/execu/online') }}";
                $.get(url,$('form').serialize(),
                        function(data){
                            //alert(data);
                            $("#tab").html(data);
                            $("#search").removeAttr("disabled");
                        });
            });
        });
    </script>
@stop
